import mapValues from "lodash/mapValues";
import { ARBITRUM } from "./chains";
import { isDevelopment } from "config/env";

export const ENABLED_MARKETS = {
  [ARBITRUM]: [],
};

export const ENABLED_MARKETS_INDEX = mapValues<Record<number, string[]>>(ENABLED_MARKETS, (markets) =>
  markets.reduce((acc, market) => ({ ...acc, [market]: true }), {})
);

export function isMarketEnabled(chainId: number, marketAddress: string) {
  if (isDevelopment()) return true;

  return ENABLED_MARKETS_INDEX[chainId]?.[marketAddress] ?? false;
}
